package com.bamboo.mall.product.service;

import com.bamboo.common.utils.PageUtils;
import com.bamboo.mall.product.entity.CategoryEntity;
import com.bamboo.mall.product.entity.dto.category.CategoryDetailDTO;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * 商品三级分类
 *
 * @author bamboo
 * @email yeyinzhu321@gmail.com
 * @date 2020-04-07 15:50:32
 */
public interface CategoryService extends IService<CategoryEntity> {

    /**
     * 分页查询
     *
     * @param params
     * @return
     */
    PageUtils queryPage(Map<String, Object> params);

    /**
     * 查询所有的分类并以树形展示
     *
     * @return
     */
    List<CategoryDetailDTO> listWithTree();

    /**
     * 根据 id 集合删除菜单
     *
     * @param asList
     */
    void removeMenuByIds(List<Long> asList);

    @Transactional
    void updateCascade(CategoryEntity category);

    List<Long> findCatelogPath(Long catelogId);
}

